﻿/**********************
* CLASS GASLAYER
* IMAGE SCROLLING LAYER
**********************/

class com.gamepackage.tilemap.layer.ImageLayer
	implements com.gamepackage.layer.tilemap.Layerable, com.gamepackage.util.Loadable
{
	private var parent: MovieClip;
	private var depth: Number;
	private var linkageId: String;
	
	private var timeline: MovieClip;
	
	private var x: Number;
	private var y: Number;
	
	function ImageLayer( parent: MovieClip, depth: Number, linkageId: String )
	{
		this.parent = parent;
		this.depth = depth;
		this.linkageId = linkageId;
		
		init();
	}
	
	private function init( Void ): Void
	{
		timeline = parent.attachMovie( linkageId , depth.toString() , depth );
	}
	
	function create( Void ): Void
	{
		//----//
	}
	
	function moveTo( x: Number, y: Number ): Void
	{
		timeline._x = -( this.x = x );
		timeline._y = -( this.y = y );
	}
	
	function getLayerWidth( Void ): Number
	{
		return timeline._width;
	}
	
	function getLayerHeight( Void ): Number
	{
		return timeline._height;
	}
	
	function getX( Void ): Number
	{
		return x;
	}
	
	function getY( Void ): Number
	{
		return y;
	}
	
	function getLoaderClip(): MovieClip
	{
		return timeline;
	}
}